
export const picsToStore=(data)=>{
    return {
        type:"GETPICS",
        data
    }
}


export function getPics(){
    return dispatch=>{
        var url='http://localhost:3000/pic/list';
        return fetch(url,{
            method:'post'
        })
        .then(res=>{
            return res.json()
        })
        .then((data)=>{
            console.log(data)
            dispatch(picsToStore(data));
        })
    }
}